home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / C / CPFaces / ICONstructor Folder / ICONstructor doc next >
Encoding:
Text File  |  1987-03-01  |  9.6 KB  |  246 lines  |  [TEXT/EDIT]

  1. ICONstructor
  2.    General Info
  3. This program will allow you to open, create, modify, animate, and hack-up 
  4. icons.  Before we get into the "how-to's" of using this program, you'll 
  5. need to know a little bit about icon resources.
  6.  
  7. ICON & ICN#
  8. There are two different objects that we generally refer to as "icons."  
  9. The icons you see in menus and dialogs usually have the resource type 
  10. 'ICON', whereas the more familiar desktop variety can be identified by 
  11. its resource type, 'ICN#'.
  12.  
  13. ICON - a 32 X 32 pixel object (128 total bytes).  Turn some pixels on or 
  14. off (1's and 0's in memory, respectively) and you get your little picture.
  15.  
  16. ICN# - called an icon list , it consists of an ICON plus a mask.  This 
  17. mask is a 32 X 32 bit entity, like an ICON, that tells the Finder how to 
  18. draw the ICON when it gets selected (clicked-on).  You put the ICON and 
  19. the mask together into a 64 X 32 bit object that the Finder can use.  A 
  20. "normal" mask is usually just the ICON's outline filled in.
  21.  
  22. ANIMATION
  23. You've probably seen Desktop icons that change when you click on (select) 
  24. them.  Scott Watson's Red Ryder has an icon like this.  How is this done?  
  25. Well, it's all in the mask.  If you take an ICON the way it appears on the 
  26. Desktop and another ICON that is the image you want when selected, take 
  27. the BitXor (Exclusive OR) of these two to create a special mask, and add 
  28. this mask to the original ICON, you get an ICN# that will produce the 
  29. desired effect.
  30. That is:
  31.       BitXor(Main ICON, ICON as Selected)  =>  Mask
  32.       Main ICON + Mask   =>   ICN# {creates the desired effect}
  33.  
  34.  
  35.  
  36. Note:  The Exclusive OR is as follows:
  37.       0  Xor  0  =>  0
  38.       1  Xor  0  =>  1
  39.       0  Xor  1  =>  1
  40.       1  Xor  1  =>  0
  41.  
  42.  
  43. Representing Icons
  44. It is convenient to represent ICONs and ICN#s as lists of hexadecimal 
  45. (base 16) numbers.  A 32 bit integer (LongInt) can be represented by a 
  46. string of eight hexadecimal characters.  32 of these numbers define an 
  47. ICON.  64 define an ICN# (32 for the ICON + 32 for the mask).
  48.  
  49.  
  50.  
  51.  
  52.  
  53. The Program
  54.  
  55. File Menu
  56.  
  57. Open...
  58. There are four ways to get icons into the program.
  59.  
  60. 1) Open TEXT - presents the standard File dialog that will allow you to 
  61. choose a text file to open.  Open TEXT will "look at" any text file but, 
  62. of course, it's looking for 32 lines of hexadecimal numbers.  From the 
  63. beginning to the end of the text file, Open TEXT reads a line of text and, 
  64. if the line contains exactly eight valid hex-characters and at most one 
  65. invalid one, it loads the number or else the line is ignored.  If the 
  66. text file contains less than 32 valid lines, the remaining lines will 
  67. be filled with zeros.  If more than 32 valid lines are present, the extras 
  68. are ignored.
  69.  
  70. 2) Open ICON rsrc - will load an ICON resource stored in a resource file 
  71. that you will choose from the File dialog.  (However, you can't get at 
  72. the ICON resources of the System file because ICONstructor won't find 
  73. them.  I have no clue why.)  You will then see a dialog that will show 
  74. the first ICON in the resource file and the question, "Is this the 
  75. resource you wish to Open/Change?"   If it is the one you want to open, 
  76. choose 'YES'.  IF not, you can search through the ICONs in the file by 
  77. choosing 'NO/NEXT' until you find the one you want, or choose 'CANCEL' 
  78. to dismiss the dialog.  If you have chosen an ICON, the ICON will be 
  79. displayed in the program window.
  80.  
  81. 3) Open ICN# rsrc - is similar to 'Open ICON rsrc' except it lets you 
  82. browse through ICN# resources.  When you find the one you want and choose 
  83. 'YES', it will load the ICON portion of the list.  It does NOT load the 
  84. mask.
  85.  
  86. 4) Use the on-screen grid, your mouse, and your talent to create your own 
  87. ICON image.
  88.  
  89.  
  90. Save ...
  91. ICONstructor allows you to save your ICONs and ICN#s as hexadecimal text 
  92. files or as resource files that the program will create for you.  
  93. (In addition you may add resources to existing resource files - see 
  94. Add ...)  However, it will NOT ask you if you want to save changes before 
  95. you quit the application.  So ... If you've got something worth keeping, 
  96. use one of the Save, Add, or Change options before you quit.
  97.  
  98. 1) Save Screen -> TEXT - creates a text file of the hex characters 
  99. showing on the screen headed by an RMaker defintion.  You get:
  100.      Type ICON = GNRL
  101.         ,128          {change this ID with EDIT or whatever}
  102.      .H
  103.      XXXX....
  104.      ........etc.
  105.  
  106. 2) Save List -> TEXT - same as 'Save Screen -> TEXT' but the list is 
  107. defined by the ICONs you have locally stored as "MAIN" and "MASK" 
  108. (see Save_Local Menu).  You also get the RMaker header as above except 
  109. the first line will read, "Type ICN# = GNRL".
  110.  
  111. 3) Save Screen -> ICON - creates a new resource file and puts the ICON 
  112. currently displayed on the screen into it.
  113.  
  114. 4) Save List -> ICN# - creates a new resource file and puts the 
  115. "MAIN"+"MASK" ICN# into it.  (See Save_Local Menu)
  116.  
  117.  
  118. Add ...
  119. The following options allow you to add an ICON or ICN# resource to the 
  120. resource fork of an existing file.  (except the System File)
  121.  
  122. 1) Add Screen as ICON - adds the ICON currently displayed on the screen 
  123. to the resource fork of an existing file that you will choose with the 
  124. SFGetFile dialog.
  125.  
  126. 2) Add List as ICN# - adds the "MAIN"+"MASK" ICN# (See Save_Local Menu) 
  127. to the resource fork of an existing file.
  128.  
  129.  
  130.  
  131. Change ...
  132. The Change options will allow you to actually alter ICON and ICN# 
  133. resources.  When dealing with ICN#s, you'll probably want your
  134. changes to be displayed on the Desktop.  To do this, you'll need to 
  135. change the appropriate ICN# in the file named "Desktop" (for application 
  136. and document icon lists).  A change to the Desktop file only will produce 
  137. the cosmetic effect and allow you to undo all changes by rebuilding the 
  138. Desktop file (re-booting with the <command> & <option> keys down).  
  139. However, if you want permanent changes, change the resource in the 
  140. application AND the Desktop.
  141.  
  142. 1) Change an ICON - displays the standard SFGetFile dialog to allow you 
  143. to choose the file that contains the ICON resource you want to change.  
  144. Browse through the ICONs in the 'OPEN/CHANGE' dialog you'll get until 
  145. you locate the one that you want to alter.  When you find it, choose 
  146. the 'YES' button and the ICON will be replaced with the one currently 
  147. showing in ICONstructor's window.
  148.  
  149. 2) Change an ICN# - same as 'Change an ICON' except you will be looking 
  150. at ICN# resources.  When you choose the 'YES' button in the dialog, the 
  151. "MAIN"+"MASK" (see Save_Local Menu) ICN# will be substituted for the list 
  152. you have chosen.
  153.  
  154.  
  155. Save_Local Menu
  156.  
  157. MAIN - the icon as it appears (unselected) on the desktop.
  158. SELECTED - as you want the icon to appear when you click on it  -  if
  159. appropriate.
  160. MASK - mask for the MAIN ICON
  161.  
  162. To work with these three 32 X 32 bit objects that you've either opened or 
  163. created, you'll need to save them within the environment of the program.  
  164. This will allow you to switch easily between them using the Show Menu 
  165. options.
  166.  
  167. Note: The options in this menu do NOT save information to disk.  They 
  168. merely provide local storage for the objects that you will be manipulating.
  169. For permanent saves, use one of the Save options in the File Menu.
  170.  
  171. 1) As Main - locally saves the icon showing on the screen as the "MAIN" 
  172. ICON, which, of course, can be the ICON portion of an ICN#.
  173.  
  174. 2) As Selected - locally saves the screen icon as the "SELECTED" ICON.  
  175. When you have ICONs saved locally as "MAIN" and as "SELECTED" you can use 
  176. the 'ANIMATE' option in the AutoMask Menu to generate a BitXor mask for 
  177. the "MAIN" ICON.
  178.  
  179. 3) As Mask - If you don't want the BitXor mask you can create your own 
  180. and use this option to save it within the program.
  181.  
  182.  
  183.  
  184. Show Menu
  185.  
  186. The Save, Add, and Change ICON options in the File Menu require that the 
  187. ICON be showing on the screen.  The Show Menu options will display the 
  188. ICONs that you have saved locally.
  189.  
  190. 1) Main - displays the "Saved Locally as Main" ICON.
  191. 2) Selected - displays the "Saved Locally as Selected" ICON.
  192. 3) Mask - displays the "Saved Locally as Mask" ICON.
  193.  
  194.  
  195. Shift & Erase Menus
  196.  
  197. 1) Shift - shifts the on-screen image one pixel in the specified 
  198. direction (left,right,up,down).  Pixels shifted off the grid are lost.
  199.  
  200. 2) Erase - simply clears the screen.  Does not effect anything that has 
  201. been saved.
  202.  
  203.  
  204. AutoMask Menu
  205.  
  206. When you have saved ICONs locally as "MAIN" and as "SELECTED", 'Animate' 
  207. in the AutoMask Menu will create a BitXor mask and automatically save it 
  208. locally as "MASK".
  209.  
  210.  
  211.  
  212. An Example
  213.  
  214. You've got a program with a hideously ugly icon.  You'd like to draw your 
  215. own (and animate it!).  Start up ICONstructor.
  216.  
  217. 1. Draw your ICON in the grid provided or open an icon to start with using 
  218. one of the Open options in the File Menu.  When you get it the way you 
  219. want it, choose "as Main" from the Save_Local Menu.
  220.  
  221. 2. Draw, open, modify or otherwise get another ICON on the screen.  This 
  222. will be the image you'll get when you click on your new icon.  Choose 
  223. "as Selected" from the Save_Local Menu.
  224.  
  225. 3. Choose "Animate" from the AutoMask Menu.  It'll probably look rather 
  226. strange - don't worry about it.
  227.  
  228. 4. Choose "Change an ICN#" from the File Menu.  It'll present you with 
  229. the standard GetFile dialog - choose "Desktop".
  230.  
  231. 5. You'll see a dialog that asks, "Is this the resource you wish to 
  232. Open/Change?" and displays an icon.  If it's displaying the ugly one, 
  233. choose the 'YES' button.  If not, choose the 'NO/NEXT' button until you 
  234. see the nasty picture that you want to modify.  "Uuugh! There it is!" you 
  235. cry in horror.  Choose the 'YES' button.
  236.  
  237. 6. Quit the program and sigh contentedly as you see that the little bugger 
  238. has been changed.
  239.  
  240.  
  241. Note: When you copy the program to another disk the changes will go with 
  242. it.  If you do want to get the old one back you can re-boot with the 
  243. <option> & <command> keys down.
  244.  
  245.  
  246.